import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";

const { createConfirm } = useMessage();

enum Api {
	list = '/couple-activity/activity/coupleActivityCarpoolBus/list',
	save = '/couple-activity/activity/coupleActivityCarpoolBus/add',
	edit = '/couple-activity/activity/coupleActivityCarpoolBus/edit',
	deleteOne = '/couple-activity/activity/coupleActivityCarpoolBus/delete',
	updateCarpoolBusStatusById = '/couple-activity/activity/coupleActivityCarpoolBus/updateCarpoolBusStatusById',
	deleteBatch = '/couple-activity/activity/coupleActivityCarpoolBus/deleteBatch',
	importExcel = '/couple-activity/activity/coupleActivityCarpoolBus/importExcel',
	exportXls = '/couple-activity/activity/coupleActivityCarpoolBus/exportXls',
	coupleActivityScenicSpotConnectionList = '/couple-activity/activity/coupleActivityCarpoolBus/listCoupleActivityScenicSpotConnectionByMainId',
	coupleActivityScenicSpotConnectionSave = '/couple-activity/activity/coupleActivityCarpoolBus/addCoupleActivityScenicSpotConnection',
	coupleActivityScenicSpotConnectionEdit = '/couple-activity/activity/coupleActivityCarpoolBus/editCoupleActivityScenicSpotConnection',
	coupleActivityScenicSpotConnectionDelete = '/couple-activity/activity/coupleActivityCarpoolBus/deleteCoupleActivityScenicSpotConnection',
	coupleActivityScenicSpotConnectionDeleteBatch = '/couple-activity/activity/coupleActivityCarpoolBus/deleteBatchCoupleActivityScenicSpotConnection',
	coupleActivityOrderList = '/couple-activity/activity/coupleActivityCarpoolBus/listCoupleActivityOrderByMainId',
	coupleActivityOrderSave = '/couple-activity/activity/coupleActivityCarpoolBus/addCoupleActivityOrder',
	coupleActivityOrderEdit = '/couple-activity/activity/coupleActivityCarpoolBus/editCoupleActivityOrder',
	coupleActivityOrderDelete = '/couple-activity/activity/coupleActivityCarpoolBus/deleteCoupleActivityOrder',
	coupleActivityOrderDeleteBatch = '/couple-activity/activity/coupleActivityCarpoolBus/deleteBatchCoupleActivityOrder',
	verificationOfIdentityCardApi = '/couple-activity/activity/coupleActivityCarpoolBus/getUserInfoObj',
	confirmCarpoolBus = '/couple-activity/activity/coupleActivityCarpoolBus/confirmCarpoolBus',
	CombinedPickupPoint = '/couple-activity/activity/coupleActivityCarpoolBus/combinedPickupPoint',
	refundAAprtOfByUserId = '/couple-activity/activity/coupleActivityCarpoolBus/refundAAprtOfByUserId',
	cancelJourenyByCarpoolBus = '/couple-activity/activity/coupleActivityCarpoolBus/cancelJourenyByCarpoolBus',
	sendInfo = '/couple-activity/activity/coupleActivityCarpoolBus/sendInfo',
	coupleActivityCarpoolBusUserAuditList = '/couple-activity/activity/coupleActivityCarpoolBus/listCoupleActivityCarpoolBusUserAuditByMainId',
	coupleActivityCarpoolBusUserAuditSave = '/couple-activity/activity/coupleActivityCarpoolBus/addCoupleActivityCarpoolBusUserAudit',
	coupleActivityCarpoolBusUserAuditEdit = '/couple-activity/activity/coupleActivityCarpoolBus/editCoupleActivityCarpoolBusUserAudit',
	coupleActivityCarpoolBusUserAuditDelete = '/couple-activity/activity/coupleActivityCarpoolBus/deleteCoupleActivityCarpoolBusUserAudit',
	coupleActivityCarpoolBusUserAuditDeleteBatch = '/couple-activity/activity/coupleActivityCarpoolBus/deleteBatchCoupleActivityCarpoolBusUserAudit',
	groupSuccessfully = '/couple-activity/activity/coupleActivityCarpoolBus/groupSuccessfully',
	boundVehicle = '/couple-activity/activity/coupleActivityCarpoolBus/boundVehicle',
	combinedTravel = '/couple-activity/activity/coupleActivityCarpoolBus/combinedTravel',
	auditJourenyByCarpoolBus = '/couple-activity/activity/coupleActivityCarpoolBus/auditJourenyByCarpoolBus',
	coupleInformDetailList = '/couple-info/info/coupleInform/listCoupleInformDetailByMainId',
	coupleActivityCarpoolBusAndLeaderList = '/couple-activity/activity/coupleActivityCarpoolBus/listCoupleActivityCarpoolBusAndLeaderByMainId',
	hopOnPointBondingTimeApi = '/couple-activity/activity/coupleActivityCarpoolBus/hopOnPointBondingTime',
	coupleActivityCarpoolBusAndLeaderSave = '/couple-activity/activity/coupleActivityCarpoolBus/addCoupleActivityCarpoolBusAndLeader',
	coupleActivityCarpoolBusAndLeaderEdit = '/couple-activity/activity/coupleActivityCarpoolBus/editCoupleActivityCarpoolBusAndLeader',
	coupleActivityCarpoolBusAndLeaderDelete = '/couple-activity/activity/coupleActivityCarpoolBus/deleteCoupleActivityCarpoolBusAndLeader',
	coupleActivityCarpoolBusAndLeaderDeleteBatch = '/couple-activity/activity/coupleActivityCarpoolBus/deleteBatchCoupleActivityCarpoolBusAndLeader',
	coupleInformDetailEdit = '/couple-info/info/coupleInform/editCoupleInformDetail',
	coupleCommentList = '/couple-activity/activity/coupleActivityCarpoolBus/listCoupleCommentByMainId',
	coupleCommentSave = '/couple-activity/activity/coupleActivityCarpoolBus/addCoupleComment',
	coupleCommentEdit = '/couple-activity/activity/coupleActivityCarpoolBus/editCoupleComment',
	coupleCommentDelete = '/couple-activity/activity/coupleActivityCarpoolBus/deleteCoupleComment',
	coupleCommentDeleteBatch = '/couple-activity/activity/coupleActivityCarpoolBus/deleteBatchCoupleComment',
	coupleActivityCarpoolBusGradientPriceList = '/couple-activity/activity/coupleActivityCarpoolBus/listCoupleActivityCarpoolBusGradientPriceByMainId',
	coupleActivityCarpoolBusGradientPriceSave = '/couple-activity/activity/coupleActivityCarpoolBus/addCoupleActivityCarpoolBusGradientPrice',
	coupleActivityCarpoolBusGradientPriceEdit = '/couple-activity/activity/coupleActivityCarpoolBus/editCoupleActivityCarpoolBusGradientPrice',
	coupleActivityCarpoolBusGradientPriceDelete = '/couple-activity/activity/coupleActivityCarpoolBus/deleteCoupleActivityCarpoolBusGradientPrice',
	coupleActivityCarpoolBusGradientPriceDeleteBatch = '/couple-activity/activity/coupleActivityCarpoolBus/deleteBatchCoupleActivityCarpoolBusGradientPrice',
}


/**
 * 列表接口
 * @param params
 */
export const coupleActivityCarpoolBusGradientPriceList = (params) => {
	if (params['mainId']) {
		return defHttp.get({ url: Api.coupleActivityCarpoolBusGradientPriceList, params });
	}
	return Promise.resolve({});
}


/**
 * 删除单个
 */
export const coupleActivityCarpoolBusGradientPriceDelete = (params, handleSuccess) => {
	return defHttp.delete({ url: Api.coupleActivityCarpoolBusGradientPriceDelete, params }, { joinParamsToUrl: true }).then(() => {
		handleSuccess();
	});
}
/**
 * 批量删除
 * @param params
 */
export const coupleActivityCarpoolBusGradientPriceDeleteBatch = (params, handleSuccess) => {
	createConfirm({
		iconType: 'warning',
		title: '确认删除',
		content: '是否删除选中数据',
		okText: '确认',
		cancelText: '取消',
		onOk: () => {
			return defHttp.delete({ url: Api.coupleActivityCarpoolBusGradientPriceDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
				handleSuccess();
			});
		}
	});
}
/**
 * 保存或者更新
 * @param params
 */
export const coupleActivityCarpoolBusGradientPriceSaveOrUpdate = (params, isUpdate) => {
	let url = isUpdate ? Api.coupleActivityCarpoolBusGradientPriceEdit : Api.coupleActivityCarpoolBusGradientPriceSave;
	return defHttp.post({ url: url, params });
}
/**
 * 导入
 */
export const coupleActivityCarpoolBusGradientPriceImportUrl = '/activity/coupleActivityCarpoolBus/importCoupleActivityCarpoolBusGradientPrice'

/**
 * 导出
 */
export const coupleActivityCarpoolBusGradientPriceExportXlsUrl = '/activity/coupleActivityCarpoolBus/exportCoupleActivityCarpoolBusGradientPrice'

/**
 * 列表接口
 * @param params
 */
export const coupleCommentList = (params) => {
	if (params['mainId']) {
		return defHttp.get({ url: Api.coupleCommentList, params });
	}
	return Promise.resolve({});
}


/**
 * 删除单个
 */
export const coupleCommentDelete = (params, handleSuccess) => {
	return defHttp.delete({ url: Api.coupleCommentDelete, params }, { joinParamsToUrl: true }).then(() => {
		handleSuccess();
	});
}
/**
 * 批量删除
 * @param params
 */
export const coupleCommentDeleteBatch = (params, handleSuccess) => {
	createConfirm({
		iconType: 'warning',
		title: '确认删除',
		content: '是否删除选中数据',
		okText: '确认',
		cancelText: '取消',
		onOk: () => {
			return defHttp.delete({ url: Api.coupleCommentDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
				handleSuccess();
			});
		}
	});
}
/**
 * 保存或者更新
 * @param params
 */
export const coupleCommentSaveOrUpdate = (params, isUpdate) => {
	let url = isUpdate ? Api.coupleCommentEdit : Api.coupleCommentSave;
	return defHttp.post({ url: url, params });
}
/**
 * 导入
 */
export const coupleCommentImportUrl = '/activity/coupleActivityCarpoolBus/importCoupleComment'

/**
 * 导出
 */
export const coupleCommentExportXlsUrl = '/activity/coupleActivityCarpoolBus/exportCoupleComment'

/**
 * 列表接口
 * @param params
 */
export const coupleInformDetailList = (params) => {
	if (params['mainId']) {
		return defHttp.get({ url: Api.coupleInformDetailList, params });
	}
	return Promise.resolve({});
}
/** 
 * 导出api
 * @param params
 */
export const getExportUrl = Api.exportXls;

/**
 * 导入api
 */
export const getImportUrl = Api.importExcel;
/**
 * 列表接口
 * @param params
 */
export const list = (params) =>
	defHttp.get({ url: Api.list, params });

/**
 * 删除单个
 */
export const deleteOne = (params, handleSuccess) => {
	return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
		handleSuccess();
	});
}

/**
 * 保存或者更新
 * @param params
 */
export const coupleInformDetailSaveOrUpdate = (params, isUpdate) => {
	let url = isUpdate ? Api.coupleInformDetailEdit : Api.coupleInformDetailSave;
	return defHttp.post({ url: url, params });
}

/**
 * 批量删除
 * @param params
 */
export const batchDelete = (params, handleSuccess) => {
	createConfirm({
		iconType: 'warning',
		title: '确认删除',
		content: '是否删除选中数据',
		okText: '确认',
		cancelText: '取消',
		onOk: () => {
			return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
				handleSuccess();
			});
		}
	});
}
/**
 * 保存或者更新
 * @param params
 */
export const saveOrUpdate = (params, isUpdate) => {
	let url = isUpdate ? Api.edit : Api.save;
	return defHttp.post({ url: url, params });
}
/**
 * 列表接口
 * @param params
 */
export const coupleActivityScenicSpotConnectionList = (params) => {
	if (params['mainId']) {
		return defHttp.get({ url: Api.coupleActivityScenicSpotConnectionList, params });
	}
	return Promise.resolve({});
}


/**
 * 删除单个
 */
export const coupleActivityScenicSpotConnectionDelete = (params, handleSuccess) => {
	return defHttp.delete({ url: Api.coupleActivityScenicSpotConnectionDelete, params }, { joinParamsToUrl: true }).then(() => {
		handleSuccess();
	});
}
/**
 * 批量删除
 * @param params
 */
export const coupleActivityScenicSpotConnectionDeleteBatch = (params, handleSuccess) => {
	createConfirm({
		iconType: 'warning',
		title: '确认删除',
		content: '是否删除选中数据',
		okText: '确认',
		cancelText: '取消',
		onOk: () => {
			return defHttp.delete({ url: Api.coupleActivityScenicSpotConnectionDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
				handleSuccess();
			});
		}
	});
}
/**
 * 保存或者更新
 * @param params
 */
export const coupleActivityScenicSpotConnectionSaveOrUpdate = (params, isUpdate) => {
	let url = isUpdate ? Api.coupleActivityScenicSpotConnectionEdit : Api.coupleActivityScenicSpotConnectionSave;
	return defHttp.post({ url: url, params });
}

/**
 * 合并上车点
 */
export const CombinedPickupPoint = (params) => {
	return defHttp.post({ url: Api.CombinedPickupPoint, params });
}
export const hopOnPointBondingTimeApi = (params) => {
	return defHttp.post({ url: Api.hopOnPointBondingTimeApi, params });
}

export const updateCarpoolBusStatusById = (params) => {
	return defHttp.post({ url: Api.updateCarpoolBusStatusById, params });
}
/**
 * 审核行程
 */
export const auditJourenyByCarpoolBus = (params) => {
	return defHttp.post({ url: Api.auditJourenyByCarpoolBus, params });
}
export const refundAAprtOfByUserId = (params) => {
	return defHttp.post({ url: Api.refundAAprtOfByUserId, params });
}
export const combinedTravel = (params) => {
	return defHttp.post({ url: Api.combinedTravel, params });
}
/**
 * 绑定车辆
 */
export const boundVehicle = (params) => {
	return defHttp.post({ url: Api.boundVehicle, params });
}
/**
 * 取消行程
 */
export const cancelJourenyByCarpoolBus = (params) => {
	return defHttp.post({ url: Api.cancelJourenyByCarpoolBus, params });
}
export const sendInfo = (params) => {
	return defHttp.post({ url: Api.sendInfo, params });
}


/**
 * 拼团成功
 */
export const groupSuccessfully = (params, handleSuccess) => {

	createConfirm({
		iconType: 'warning',
		title: '确认该行程拼团成功',
		content: '是否确认，确认后该行程进入待出行状态',
		okText: '确认',
		cancelText: '取消',
		onOk: () => {
			return defHttp.post({ url: Api.groupSuccessfully, data: params }, { joinParamsToUrl: true }).then(() => {
				handleSuccess();
			});
		}
	});

}
export const verificationOfIdentityCardApi = (params) => {
	return defHttp.get({ url: Api.verificationOfIdentityCardApi, params });
}
/**
 * 导入
 */
export const coupleActivityScenicSpotConnectionImportUrl = '/couple-activity/activity/coupleActivityCarpoolBus/importCoupleActivityScenicSpotConnection'

/**
 * 导出
 */
export const coupleActivityScenicSpotConnectionExportXlsUrl = '/couple-activity/activity/coupleActivityCarpoolBus/exportCoupleActivityScenicSpotConnection'

/**
 * 列表接口
 * @param params
 */
export const coupleActivityOrderList = (params) => {
	if (params['carpoolBus']) {
		return defHttp.get({ url: Api.coupleActivityOrderList, params });
	}
	return Promise.resolve({});
}


/**
 * 删除单个
 */
export const coupleActivityOrderDelete = (params, handleSuccess) => {
	return defHttp.delete({ url: Api.coupleActivityOrderDelete, params }, { joinParamsToUrl: true }).then(() => {
		handleSuccess();
	});
}
/**
 * 批量删除
 * @param params
 */
export const coupleActivityOrderDeleteBatch = (params, handleSuccess) => {
	createConfirm({
		iconType: 'warning',
		title: '确认删除',
		content: '是否删除选中数据',
		okText: '确认',
		cancelText: '取消',
		onOk: () => {
			return defHttp.delete({ url: Api.coupleActivityOrderDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
				handleSuccess();
			});
		}
	});
}
/**
 * 保存或者更新
 * @param params
 */
export const coupleActivityOrderSaveOrUpdate = (params, isUpdate) => {
	let url = isUpdate ? Api.coupleActivityOrderEdit : Api.coupleActivityOrderSave;
	return defHttp.post({ url: url, params });
}

/**
 * 导入
 */
export const coupleActivityOrderImportUrl = '/couple-activity/activity/coupleActivityCarpoolBus/importCoupleActivityOrder'

/**
 * 导出
 */
export const coupleActivityOrderExportXlsUrl = '/couple-activity/activity/coupleActivityCarpoolBus/exportCoupleActivityOrder'


/**
 * 计量操作，取消行程、合并团、拼团成功、给某个行程的订单发送通知
 */
export const confirmCarpoolBus = (params, handleSuccess) => {

	return defHttp.post({ url: Api.confirmCarpoolBus, params }).then(() => {
		handleSuccess();
	});

}
/**
 * 列表接口
 * @param params
 */
export const coupleActivityCarpoolBusAndLeaderList = (params) => {
	if (params['carpoolBus']) {
		return defHttp.get({ url: Api.coupleActivityCarpoolBusAndLeaderList, params });
	}
	return Promise.resolve({});
}


/**
 * 删除单个
 */
export const coupleActivityCarpoolBusAndLeaderDelete = (params, handleSuccess) => {
	return defHttp.delete({ url: Api.coupleActivityCarpoolBusAndLeaderDelete, params }, { joinParamsToUrl: true }).then(() => {
		handleSuccess();
	});
}
/**
 * 批量删除
 * @param params
 */
export const coupleActivityCarpoolBusAndLeaderDeleteBatch = (params, handleSuccess) => {
	createConfirm({
		iconType: 'warning',
		title: '确认删除',
		content: '是否删除选中数据',
		okText: '确认',
		cancelText: '取消',
		onOk: () => {
			return defHttp.delete({ url: Api.coupleActivityCarpoolBusAndLeaderDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
				handleSuccess();
			});
		}
	});
}
/**
 * 保存或者更新
 * @param params
 */
export const coupleActivityCarpoolBusAndLeaderSaveOrUpdate = (params, isUpdate) => {
	let url = isUpdate ? Api.coupleActivityCarpoolBusAndLeaderEdit : Api.coupleActivityCarpoolBusAndLeaderSave;
	return defHttp.post({ url: url, params });
}
/**
 * 导入
 */
export const coupleActivityCarpoolBusAndLeaderImportUrl = '/activity/coupleActivityCarpoolBus/importCoupleActivityCarpoolBusAndLeader'

/**
 * 导出
 */
export const coupleActivityCarpoolBusAndLeaderExportXlsUrl = '/activity/coupleActivityCarpoolBus/exportCoupleActivityCarpoolBusAndLeader'

/**
 * 列表接口
 * @param params
 */
export const coupleActivityCarpoolBusUserAuditList = (params) => {
	if (params['carpoolBus']) {
		return defHttp.get({ url: Api.coupleActivityCarpoolBusUserAuditList, params });
	}
	return Promise.resolve({});
}


/**
 * 删除单个
 */
export const coupleActivityCarpoolBusUserAuditDelete = (params, handleSuccess) => {
	return defHttp.delete({ url: Api.coupleActivityCarpoolBusUserAuditDelete, params }, { joinParamsToUrl: true }).then(() => {
		handleSuccess();
	});
}
/**
 * 批量删除
 * @param params
 */
export const coupleActivityCarpoolBusUserAuditDeleteBatch = (params, handleSuccess) => {
	createConfirm({
		iconType: 'warning',
		title: '确认删除',
		content: '是否删除选中数据',
		okText: '确认',
		cancelText: '取消',
		onOk: () => {
			return defHttp.delete({ url: Api.coupleActivityCarpoolBusUserAuditDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
				handleSuccess();
			});
		}
	});
}
/**
 * 保存或者更新
 * @param params
 */
export const coupleActivityCarpoolBusUserAuditSaveOrUpdate = (params, isUpdate) => {
	let url = isUpdate ? Api.coupleActivityCarpoolBusUserAuditEdit : Api.coupleActivityCarpoolBusUserAuditSave;
	return defHttp.post({ url: url, params });
}
/**
 * 导入
 */
export const coupleActivityCarpoolBusUserAuditImportUrl = '/activity/coupleActivityCarpoolBus/importCoupleActivityCarpoolBusUserAudit'

/**
 * 导出
 */
export const coupleActivityCarpoolBusUserAuditExportXlsUrl = '/activity/coupleActivityCarpoolBus/exportCoupleActivityCarpoolBusUserAudit'